<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- saved from url=(0051)file:///E:/git/jquery-oembed/examples/callback.html -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>OnProviderNotFound</title>
	<meta http-equiv="content-type" content="text/html; charset=utf-8"/>    
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>  
	<script type="text/javascript" src="../jquery.oembed.js"></script>
</head>
<body>
<script type="text/javascript">
	$(document).ready(function() {
		$(".oembed").oembed(null, {			
			onProviderNotFound: function(url) {					
				if (url != null) {
					var regExp = new RegExp("http.*\.[jpg|gif|png]", "i");					
					if (url.match(regExp) != null) {
						$(this).html('<img src="' + url + '" />');				
					}				
				}
			},
			greedy: false });
	});
</script>
<div><a href="http://upload.wikimedia.org/wikipedia/en/thumb/1/15/Life_On_Mars_OST.jpg/220px-Life_On_Mars_OST.jpg)" class="oembed">A linked image</a></div>
</body></html>